1
Programming as Data Transformation
AI019 Lesson 1
00:00

In Elixir, we abandon the imperative model of modifying state for a flow-based approach where programs are discrete, pure transformations. Instead of telling the computer how to change a value, we define a pipeline of functions where Programming Should Be About Transforming Data.

1. The Immutability Mandate

In Elixir, all values are immutable. Once data is created, it cannot be altered. This ensures that Immutable Data Is Known Data—information will never change unexpectedly, eliminating massive categories of state-related bugs. This transformation never mutates data; instead, each function creates a new, fresh version of the data.

Raw DataTransformationNew State|>|>

2. The Pipe Philosophy

The pipe operator (|>) treats data like a fluid moving through a factory line. A functional programming language lets us think in terms of functions that transform data step-by-step.

3. The Actor Context

In the Erlang VM (BEAM), code runs in tiny concurrent processes, each with its own state. Processes talk to each other via messages. Because communication happens by message-passing, exchanging data between different machines on a network is handled transparently by the VM.

main.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute.
>